package org.pearl.thread.demo.test001;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * Created by TD on 2021/4/9
 */
public class Test003 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        MyCallable001 myCallable001 = new MyCallable001();

        FutureTask<String> futureTask001 = new FutureTask<>(myCallable001);

        Thread thread001 = new Thread(futureTask001);

        thread001.start();

        System.out.println(Thread.currentThread().getName() + "线程正在运行任务");
        System.out.println(futureTask001.get());
    }
}
